﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DAO;
using DTO;

namespace BUS
{
    public class PinBUS
    {
/*-------------------------LOAD----------------------------------------------------
LOADPIN
LOADPIN_THEOSTT @STT_Pin int
LOADPIN_THEOMATHONGSO @MaThongSo int
LOADPIN_THEOLOAI @LoaiPin nvarchar(10)
 */
        
        public DataTable LoadPin()
        {
            PinDAO _pin = new PinDAO();
            return _pin.LoadPin();
        }
        public DataTable LoadPin_TheoSTT(int STT_Pin)
        {
            PinDAO _pin = new PinDAO();
            return _pin.LoadPin_TheoSTT(STT_Pin);
        }
        public DataTable LoadPin_TheoMaThongSo(int MaThongSo)
        {
            PinDAO _pin = new PinDAO();
            return _pin.LoadPin_TheoMaThongSo(MaThongSo);
        }
        public DataTable LoadPin_TheoLoai(int LoaiPin)
        {
            PinDAO _pin = new PinDAO();
            return _pin.LoadPin_TheoLoai(LoaiPin);
        }
/*-------------------------INSERT----------------------------------------------------
THEMPIN @STT_Pin int out, @LoaiPin nvarchar(10),@VMin decimal@VMax decimal,@AMin decimal, @AMax decimal, @MaThongSo int
*/
        public int ThemPin(PinDTO pin)
        {
            PinDAO _pin = new PinDAO();
            return _pin.ThemPin(pin);
        }
/*-------------------------UPDATE----------------------------------------------------
SUAPIN @STT_Pin int, @LoaiPin nvarchar(10), @VMin decimal,@VMax decimal,@AMin decimal,@AMax decimal
*/
        public int SuaPin(PinDTO pin)
        {
            PinDAO _pin = new PinDAO();
            return _pin.SuaPin(pin);
        }
/*-------------------------DELETE----------------------------------------------------
XOAPIN @STT_Pin int out
*/
        public int XoaPin(int STT_Pin)
        {
            PinDAO _pin = new PinDAO();
            int kq =_pin.XoaPin(STT_Pin);
            return kq;
        }
    }
}
